area logo [ state[inactive] = (0, 0) state[active] = (0, 17) ] area mode [ state[clock] = (102, 2) state[alarm] = (142, 2) state[timer] = (180, 2) state[counter] = (217, 2) function OnMouseDown() { PlaySound(beep2.wav) IfState(mode, clock) Command(goto_alarm_mode) Else { IfState(mode, alarm) Command(goto_timer_mode) Else { IfState(mode, timer) Command(goto_counter_mode) Else { IfState(mode, counter) Command(goto_clock_mode) }}} } function OnState(clock) { SetState(go_button, default) } function OnState(alarm) { SetState(go_button, default) } function OnState(counter) { IfState(counter_active, on) SetState(go_button, on) Else SetState(go_button, off) } function OnState(timer) { IfState(timer_active, on) SetState(go_button, on) Else SetState(go_button, off) } ] area snooze [ state[on] = (101, 13) state[off] = (101, 24) moveable ] area menu [ state[mouse_over] = (143, 14) state[mouse_out] = (161, 14) ] area minimize [ state[mouse_out] = (178, 13) state[mouse_over] = (192, 13) state[mouse_down] = (206, 13) ] area close [ state[mouse_out] = (178, 24) state[mouse_over] = (189, 24) state[mouse_down] = (200, 24) ] area toggle_ampm [ moveable ] area go_button [ state[off] = (220, 13) state[on] = (234, 13) function OnMouseDown() { IfNotState(mode, clock) {IfNotState(mode, alarm) { PlaySound(beep1.wav) IfState(mode, counter) { IfState(counter_active, off) Command(start_counter) else Command(stop_counter) } Else { IfState(mode, timer) { IfState(timer_active, off) Command(start_timer) Else Command(stop_timer) }} }} } ] area size_down [ state[disabled] = (36, 34) state[mouse_out] = (36, 34) state[mouse_over] = (48, 34) state[mouse_down] = (60, 34) ] area size_up [ state[disabled] = (0, 34) state[mouse_out] = (0, 34) state[mouse_over] = (12, 34) state[mouse_down] = (24, 34) ] area counter_active [ function OnState(on) { IfState(mode, counter) SetState(go_button, on) } function OnState(off) { IfState(mode, counter) SetState(go_button, off) } ] area timer_active [ function OnState(on) { IfState(mode, timer) SetState(go_button, on) } function OnState(off) { IfState(mode, timer) SetState(go_button, off) } ]